Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Fatsoma payment process #1

Open
wants to merge 36 commits into
base: master
Choose a base branch
from
Open

Conversation

biinari
Copy link
Member

@biinari biinari commented May 6, 2021

https://www.pivotaltracker.com/story/show/174342202

This work should be cherry-picked out into multiple PRs to request
changes upstream. For brevity, all changes are being made for supporting
Fatsoma here.

  • Add Webhook Endpoints resource at /v1/webhook_endpoints. Keep
    existing /_config/webhooks for registering webhooks with specified
    secrets.
  • Fix LOCALSTRIPE_SOURCE in js to work when not the last script
    element in the page.
  • Add Account resource at /v1/accounts and standard account at
    /v1/account
  • Add middleware to strip trailing slash from URLs
  • Add details to 400: Bad Request errors to indicate which params
    are missing or invalid.
  • Add Stripe Connect resources
  • Add Payment Intent resources
  • Anything else?

Add API for webhooks following stripe's API. Keep existing /_config/webhooks
for registering webhooks with predefined secrets.
When localstripe is injected into the page, it may not be the last script
element. Find a script that matches a domain followed by js.stripe.com/v3

Also allow starting with '//', 'http://' or 'https://'
Give extra data to Bad Request errors to explain which parameter is missing
or invalid.
Allow Stripe to be instantiated with the 'new' operator.
canMakePayment resolves null to indicate no support for any paymentRequest.
Support creating Elements of types: card, cardNumber, cardExpiry, cardCvc.
Add off() to remove event listener
Add extra methods for Element: blur, focus, clear, update.
Trigger extra events: ready, blur, focus.
biinari added 12 commits May 7, 2021 05:31
Pass event object to listeners for change event
Filter customers by email if param is present
Add created, succeeded, payment_failed, canceled webhooks for payment_intent
Add payment_method.attached, payment_method.detached webhook events
Calls confirmCardPayment() with option handleNextAction: false
At debug level, log when sending a webhook.
Move dockerfile from README to its own Dockerfile
Allow specifying a standard and stripe connect webhook through env vars:

WEBHOOK_URL
WEBHOOK_SIGNING_SECRET
CONNECT_WEBHOOK_URL
CONNECT_WEBHOOK_SIGNING_SECRET

Or through vault using AWS IAM authentication, needing these env vars:

VAULT_ADDR
VAULT_ROLE
ENVIRONMENT

will look at `secret/fatsoma/${ENVIRONMENT}/api/payment` for keys:

stripe_webhook_url
stripe_webhook_signing_secret
stripe_connect_webhook_url
stripe_connect_webhook_signing_secret
Allow health check to use /_status without auth
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants